# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libjcat
pkgver=0.2.1
pkgrel=0
pkgdesc="Library for reading and writing Jcat files"
url="https://github.com/hughsie/libjcat"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	glib-dev
	gnutls-dev
	gnutls-utils
	gobject-introspection-dev
	gpgme-dev
	help2man
	json-glib-dev
	libgpg-error-dev
	meson
	py3-setuptools
	vala
	"
subpackages="$pkgname-dev $pkgname-tools $pkgname-doc"
source="https://github.com/hughsie/libjcat/archive/$pkgver/libjcat-$pkgver.tar.gz"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dgtkdoc=false \
		-Dcli=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	rm -rf "$pkgdir"/usr/libexec/installed-tests
}

tools() {
	amove usr/bin
}

sha512sums="
e29fdaae38ade2960ffa7ac3cd41224ccab5fdb351d2ae420ffe0cf0ddb948bba37e9e040cc3046c8593be4622bf018779dfa80f173873b79582061f12c02373  libjcat-0.2.1.tar.gz
"
